import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class MainService {
  // private sider = 'http://localhost:3000/sider';
  private sider = '/assets/json/sider.json';
  private news = '/assets/json/news.json';

  constructor(private http: HttpClient) {
  }

  public getSider(data) {
    return this.http.get(this.sider);
    // return this.http.post(this.sider, data, {
    //   headers: {
    //     'Content-Type': 'application/json; charset=utf-8'
    //   }
    // });
  }

  public getNews(data) {
    return this.http.get(this.news);
    // return this.http.post(this.news, data, {
    //   headers: {
    //     'Content-Type': 'application/json; charset=utf-8'
    //   }
    // });
  }
}
